﻿import requests
import json

response = requests.get('http://localhost:5000/api/get_all_documents')
if response.status_code == 200:
    result = response.json()
    print(' 批量导入验证成功！')
    print(f' 总文档数: {result["total_count"]}')
    print(f' 状态: {result["status"]}')
    print(f' 消息: {result["message"]}')
    print('\n 前5个文档预览:')
    for i, doc in enumerate(result['documents'][:5], 1):
        print(f'{i}. ID: {doc["id"]}')
        print(f'   标题: {doc["metadata"].get("title", "无标题")}')
        print(f'   内容预览: {doc["document"][:80]}...')
        print()
else:
    print(f' 请求失败: {response.status_code}')
